package day6;

import java.io.*;

/**
 * @author oldliu
 * @since 1.0
 */
public class DataInOutput {
    public static void main(String[] args) {
        //写基本类型
//        try {
//            DataOutputStream  dout=new DataOutputStream(new FileOutputStream("E:/temp/2.txt"));
//            dout.writeInt(10000);
//            dout.writeDouble(Math.E);
//            dout.writeBoolean(2>100);
//            dout.writeBoolean(2<100);
//            dout.writeUTF("老刘最handsome");
//            dout.close();
//        } catch (IOException  e) {
//            e.printStackTrace();
//        }
        try {
            DataInputStream din=new DataInputStream(new FileInputStream("E:/temp/2.txt"));
            System.out.println(din.readInt());
            System.out.println(din.readDouble());
            System.out.println(din.readBoolean());
            System.out.println(din.readBoolean());
            System.out.println(din.readUTF());
            din.close();
        }  catch (IOException e) {
            e.printStackTrace();
        }

    }
}
